package card;

import java.util.ArrayList;
import java.util.List;

public class Test {

    public static void main(String[] args) {

        CardGame cardGame = new CardGame();
        List<Card> cardList = cardGame.buyCard();
        System.out.println(cardList);

        System.out.println("洗牌后");
        cardGame.shuffle(cardList);
        System.out.println(cardList);

        //为三个玩家申请
        List<Card> hand1 = new ArrayList<>();
        List<Card> hand2 = new ArrayList<>();
        List<Card> hand3 = new ArrayList<>();

        List<List<Card>> hands = new ArrayList<>();
        //hands的0，1，2分别对应玩家1，2，3的牌
        hands.add(hand1);
        hands.add(hand2);
        hands.add(hand3);

        for(int i = 0; i < 5; i++) {
            for(int j = 0; j < 3; j++) {
                Card card = cardList.remove(0);
                hands.get(j).add(card);
            }
        }

        System.out.println("第一个玩家的牌：" + hands.get(0));
        System.out.println("第二个玩家的牌："  + hands.get(1));
        System.out.println("第三个玩家的牌：" + hands.get(2));


    }


}
